<!DOCTYPE html>
<html lang="zh-cn" manifest="cache.manifest">
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type">
    <title>Offine</title>

</head>
<body>
<div id="info"></div>
<a href="ab.html">ab</a>
<a href="c.html">c</a>
<button id="gengxin">更新</button>
更信了
<script type="text/javascript">
    window.addEventListener("online", function(e) {
        log("Online");
    }, true);

    window.addEventListener("offline", function(e) {
        log("Offline");
    }, true);
 

    function log() {
        var s = '';

        s = Array.prototype.join.call(arguments, ' ');
        var p = document.createElement('p');
        p.innerHTML = s;
        var info = document.getElementById('info');

        info.appendChild(p);
    }
    
    window.applicationCache.onchecking = function(e) {
        log("检查更新");

    };

    window.applicationCache.onnoupdate = function(e) {
        log("没有可更新的");
    };

    window.applicationCache.onupdateready = function(e) {
        window.applicationCache.swapCache();
        log("更新完成");
    };

    window.applicationCache.onobsolete = function(e) {
        log("更新中断");
    };

    window.applicationCache.ondownloading = function(e) {
        log("下载更新中");
    };

    window.applicationCache.oncached = function(e) {
        log("已缓存");
    };

    window.applicationCache.onerror = function(e) {
        log("缓存失败");
    };

</script>

</body>
</html>